Undefined function pg_connect()

Undefined function pg_connect()

am 28.01.2010 01:25:44 von Gustavo Amarilla Santacruz

--0016e65b40e277be84047e2e902f
Content-Type: text/plain; charset=ISO-8859-1

Hello, all.

I had installed php + postgresql on Fedora12. When the php script call to
"pg_connect()", the following message is displayed:

Fatal error: Call to undefined function pg_connect() in /var/www/html/ .....
Call Stack: 0.0325 487160 1. {main}() ....


What i can do?


Thank you, in advance.


-------------------------
Gustavo Amarilla

--0016e65b40e277be84047e2e902f
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hello, all.

I had installed php + postgresql on Fedora12. When the p=
hp script call to "pg_connect()", the following message is displa=
yed:

Fatal error=
: Call to undefined function pg_connect() in
/var/www/html/ ..... Call Stack: 0.0325 487160 1. {main}()
.....



What i can do?


Thank you, i=
n advance.


-------------------------
Gustavo Amarilla


--0016e65b40e277be84047e2e902f--

Re: Undefined function pg_connect()

am 28.01.2010 01:36:51 von dmagick

Gustavo Amarilla Santacruz wrote:
> Hello, all.
>
> I had installed php + postgresql on Fedora12. When the php script call
> to "pg_connect()", the following message is displayed:
>
> Fatal error: Call to undefined function pg_connect() in /var/www/html/
> ..... Call Stack: 0.0325 487160 1. {main}() ....
>
>
> What i can do?

You need the php-pgsql package if you installed via rpm.

Once you have that installed, restart apache and see how you go.

--
Postgresql & php tutorials
http://www.designmagick.com/


--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Undefined function pg_connect()

am 28.01.2010 01:40:47 von devrim

On Wed, 2010-01-27 at 21:25 -0300, Gustavo Amarilla Santacruz wrote:

> I had installed php + postgresql on Fedora12. When the php script call
> to "pg_connect()", the following message is displayed:
>=20
> Fatal error: Call to undefined function pg_connect()=20

If you are installing from RPMs, you also need to install php-pgsql
package. If you are installing from sources, you will need to recompile
with PostgreSQL support.

--=20
Devrim GÜNDÜZ, RHCE
Command Prompt - http://www.CommandPrompt.com=20
devrim~gunduz.org, devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
http://www.gunduz.org Twitter: http://twitter.com/devrimgunduz


--=20
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Undefined function pg_connect()

am 28.01.2010 14:35:49 von Gustavo Amarilla Santacruz

--0016e6d9746e06ed47047e399af1
Content-Type: text/plain; charset=ISO-8859-1

Thank you, Chris.

I use the yum command and i got the following result:

yum install php-pgsql
Loaded plugins: presto, refresh-packagekit
Setting up Install Process
Package php-pgsql-5.3.1-1.fc12.i686 already installed and latest version
Nothing to do


What i can do?

Thank you, in advance.



On Wed, Jan 27, 2010 at 9:36 PM, Chris wrote:

> Gustavo Amarilla Santacruz wrote:
>
>> Hello, all.
>>
>> I had installed php + postgresql on Fedora12. When the php script call to
>> "pg_connect()", the following message is displayed:
>>
>> Fatal error: Call to undefined function pg_connect() in /var/www/html/
>> ..... Call Stack: 0.0325 487160 1. {main}() ....
>>
>>
>> What i can do?
>>
>
> You need the php-pgsql package if you installed via rpm.
>
> Once you have that installed, restart apache and see how you go.
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>
>


---------------------------
Gustavo Amarilla

--0016e6d9746e06ed47047e399af1
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Thank you, Chris.

I use the=A0 yum command and i got the following r=
esult:

yum insta=
ll php-pgsql

style=3D"font-family: courier new,monospace;">Loaded plugins: presto, refre=
sh-packagekit



Setting up Install Proc=
ess

font-family: courier new,monospace;">Package php-pgsql-5.3.1-1.fc12.i686 al=
ready installed and latest version

new,monospace;">

Nothing to do >

What i can do?

Thank you, in advance.



lass=3D"gmail_quote">On Wed, Jan 27, 2010 at 9:36 PM, Chris r"><> > wrote:


204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
>Gustavo Amarilla Santacruz wrote:

204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello, all.



I had installed php + postgresql on Fedora12. When the php script call to &=
quot;pg_connect()", the following message is displayed:



Fatal error: Call to undefined function pg_connect() in /var/www/html/ ....=
.. Call Stack: 0.0325 487160 1. {main}() ....





What i can do?




You need the php-pgsql package if you installed via rpm.



Once you have that installed, restart apache and see how you go.
olor=3D"#888888">


--

Postgresql & php tutorials

http://www.desig=
nmagick.com/







-----------------------=
----
Gustavo Amarilla


--0016e6d9746e06ed47047e399af1--

Re: Undefined function pg_connect()

am 28.01.2010 14:44:15 von Bill Moran

In response to Gustavo Amarilla Santacruz :

> Thank you, Chris.
>
> I use the yum command and i got the following result:
>
> yum install php-pgsql
> Loaded plugins: presto, refresh-packagekit
> Setting up Install Process
> Package php-pgsql-5.3.1-1.fc12.i686 already installed and latest version
> Nothing to do

Have you restarted Apache since it was successfully installed?

--
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Undefined function pg_connect()

am 29.01.2010 00:40:48 von Gustavo Amarilla Santacruz

--001485f44e9a9e28b6047e420d34
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Thank you, Bill Moran.

My httpd is stoped, for default.

I used the command: service httpd start; then, the following message was
displayed:

Starting httpd: [Thu Jan 28 20:27:39 2010] [warn] module perl_module is
already loaded, skipping
[Thu Jan 28 20:27:39 2010] [warn] module php5_module is already loaded,
skipping
httpd: Could not reliably determine the server's fully qualified domain
name, using localhost.localdomain for ServerName
[ OK ]


But the pg_connect function is not recognized.

On Thu, Jan 28, 2010 at 10:44 AM, Bill Moran wrot=
e:

> In response to Gustavo Amarilla Santacruz :
>
> > Thank you, Chris.
> >
> > I use the yum command and i got the following result:
> >
> > yum install php-pgsql
> > Loaded plugins: presto, refresh-packagekit
> > Setting up Install Process
> > Package php-pgsql-5.3.1-1.fc12.i686 already installed and latest versio=
n
> > Nothing to do
>
> Have you restarted Apache since it was successfully installed?
>
> --
> Bill Moran
> http://www.potentialtech.com
> http://people.collaborativefusion.com/~wmoran/ efusion.com/%7Ewmoran/>
>



--=20
Gustavo Amarilla

=BFReciclaste papel, hoy?

--001485f44e9a9e28b6047e420d34
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Thank you, Bill Moran.

My httpd is stoped, for default.

I use=
d the command: service =
httpd start
; then, the following message was displayed:

style=3D"font-family: courier new,monospace;">Starting httpd: [Thu Jan 28 =
20:27:39 2010] [warn] module perl_module is already loaded, skipping=



[Thu Jan 28 20:27:39 20=
10] [warn] module php5_module is already loaded, skipping

=3D"font-family: courier new,monospace;"> r new,monospace;">httpd: Could not reliably determine the server's full=
y qualified domain name, using localhost.localdomain for ServerName
<=
br style=3D"font-family: courier new,monospace;">

      =A0=
                         =A0=
                         =A0=
=A0 [=A0 OK=A0 ]



But the pg_connect function is not recog=
nized.

On Thu, Jan 28, 2010 at 10:44 AM, =
Bill Moran < ">wmoran@potentialtech.com> wrote:


204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">In response to Gu=
stavo Amarilla Santacruz <gusamas=
an@gmail.com
>:





> Thank you, Chris.

>

> I use the =A0yum command and i got the following result:

>

> yum install php-pgsql

> Loaded plugins: presto, refresh-packagekit

> Setting up Install Process

> Package php-pgsql-5.3.1-1.fc12.i686 already installed and latest versi=
on

> Nothing to do



Have you restarted Apache since it was successfully installed?




--
Gustavo Ama=
rilla

=BFReciclaste papel, hoy?


--001485f44e9a9e28b6047e420d34--

Re: Undefined function pg_connect()

am 29.01.2010 00:53:19 von dmagick

Gustavo Amarilla Santacruz wrote:
> Thank you, Bill Moran.
>
> My httpd is stoped, for default.
>
> I used the command: service httpd start; then, the following message was
> displayed:
>
> Starting httpd: [Thu Jan 28 20:27:39 2010] [warn] module perl_module is
> already loaded, skipping
> [Thu Jan 28 20:27:39 2010] [warn] module php5_module is already loaded,
> skipping
> httpd: Could not reliably determine the server's fully qualified domain
> name, using localhost.localdomain for ServerName
> [ OK ]
>
>
> But the pg_connect function is not recognized.

Does a phpinfo() page show it loading anything re: pgsql ?

Anything in apache logs (/var/log/httpd/error.log probably) ?

Could seLinux be involved somehow (I'm not really sure where to look for
this, something in /var/log should have some info) ?


On your phpinfo page, it should have something like this:

Configuration File (php.ini) Path /etc/php.ini
Scan this dir for additional .ini files /etc/php.d


Check whether the rpm put a file in that extra directory, like:

# cat /etc/php.d/pgsql.ini
; Enable pgsql extension module
extension=pgsql.so

If it didn't, try doing it manually (and restart httpd) and see if pgsql
shows up in your phpinfo page now.

--
Postgresql & php tutorials
http://www.designmagick.com/


--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Undefined function pg_connect()

am 30.01.2010 02:07:27 von Gustavo Amarilla Santacruz

--0016e6dab0fd566b97047e5761d3
Content-Type: text/plain; charset=ISO-8859-1

On Thu, Jan 28, 2010 at 8:53 PM, Chris wrote:

> Gustavo Amarilla Santacruz wrote:
>
>> Thank you, Bill Moran.
>>
>> My httpd is stoped, for default.
>>
>> I used the command: service httpd start; then, the following message was
>> displayed:
>>
>> Starting httpd: [Thu Jan 28 20:27:39 2010] [warn] module perl_module is
>> already loaded, skipping
>> [Thu Jan 28 20:27:39 2010] [warn] module php5_module is already loaded,
>> skipping
>> httpd: Could not reliably determine the server's fully qualified domain
>> name, using localhost.localdomain for ServerName
>> [ OK ]
>>
>>
>> But the pg_connect function is not recognized.
>>
>
> Does a phpinfo() page show it loading anything re: pgsql ?
>
> Anything in apache logs (/var/log/httpd/error.log probably) ?
>
> Could seLinux be involved somehow (I'm not really sure where to look for
> this, something in /var/log should have some info) ?
>
>
> On your phpinfo page, it should have something like this:
>
> Configuration File (php.ini) Path /etc/php.ini
> Scan this dir for additional .ini files /etc/php.d
>
>
> Check whether the rpm put a file in that extra directory, like:
>
> # cat /etc/php.d/pgsql.ini
> ; Enable pgsql extension module
> extension=pgsql.so
>
> If it didn't, try doing it manually (and restart httpd) and see if pgsql
> shows up in your phpinfo page now.
>
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>
>


Thank you, Chris



*1) Does a phpinfo() page show it loading anything re: pgsql ?*

No, no matter info on pgsql.


*2) Anything in apache logs (/var/log/httpd/error.log probably) ?*

Yes, i found this:

..
..
..
PHP Warning: PHP Startup: Unable to load dynamic library
'./;/usr/lib/php/modules/;/usr/lib/pgsql/curl.so' -
../;/usr/lib/php/modules/;/usr/lib/pgsql/curl.so: cannot open shared object
file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library
'./;/usr/lib/php/modules/;/usr/lib/pgsql/fileinfo.so' -
../;/usr/lib/php/modules/;/usr/lib/pgsql/fileinfo.so: cannot open shared
object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library
'./;/usr/lib/php/modules/;/usr/lib/pgsql/json.so' -
../;/usr/lib/php/modules/;/usr/lib/pgsql/json.so: cannot open shared object
file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library
'./;/usr/lib/php/modules/;/usr/lib/pgsql/ldap.so' -
../;/usr/lib/php/modules/;/usr/lib/pgsql/ldap.so: cannot open shared object
file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library
'./;/usr/lib/php/modules/;/usr/lib/pgsql/mysql.so' -
../;/usr/lib/php/modules/;/usr/lib/pgsql/mysql.so: cannot open shared object
file: No such file or directory in Unknown on line 0
..
..
..


*
3) On your phpinfo page, it should have something like this:

Configuration File (php.ini) Path /etc/php.ini
Scan this dir for additional .ini files /etc/php.d

*
Yes, the phpinfo page has this information.

*
4) Check whether the rpm put a file in that extra directory, like:

# cat /etc/php.d/pgsql.ini
; Enable pgsql extension module
extension=pgsql.so*


Yes, the rpm put that file in /etc/php.d




----------------------------
Gustavo Amarilla

--0016e6dab0fd566b97047e5761d3
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable



On Thu, Jan 28, 2010 at 8:53 PM, Chris <=
span dir=3D"ltr"><dmagick@gmail.com=
> wrote:
-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-lef=
t: 1ex;">

Gustavo Amarilla Santacruz wrote:

204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thank you, Bill Moran.



My httpd is stoped, for default.



I used the command: service httpd start; then, the following message was di=
splayed:



Starting httpd: [Thu Jan 28 20:27:39 2010] [warn] module perl_module is alr=
eady loaded, skipping

[Thu Jan 28 20:27:39 2010] [warn] module php5_module is already loaded, ski=
pping

httpd: Could not reliably determine the server's fully qualified domain=
name, using localhost.localdomain for ServerName

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 [ =A0OK =A0]





But the pg_connect function is not recognized.




Does a phpinfo() page show it loading anything re: pgsql ?



Anything in apache logs (/var/log/httpd/error.log probably) ?



Could seLinux be involved somehow (I'm not really sure where to look fo=
r this, something in /var/log should have some info) ?





On your phpinfo page, it should have something like this:



Configuration File (php.ini) Path =A0 =A0 =A0 /etc/php.ini

Scan this dir for additional .ini files =A0 =A0 =A0 =A0 /etc/php.d





Check whether the rpm put a file in that extra directory, like:



# cat /etc/php.d/pgsql.ini

; Enable pgsql extension module

extension=3Dpgsql.so



If it didn't, try doing it manually (and restart httpd) and see if pgsq=
l shows up in your phpinfo page now.




--

Postgresql & php tutorials

http://www.desig=
nmagick.com/







Thank you, Chris



clear=3D"all">1) Does a phpinfo() page show it loading anything re: p=
gsql ?


No, no matter info on pgsql.


2) Anyt=
hing in apache logs (/var/log/httpd/error.log probably) ?




Yes, i found this:

>.
ont-family: courier new,monospace;"> ,monospace;">.


.
nt-family: courier new,monospace;"> monospace;">PHP Warning:=A0 PHP Startup: Unable to load dynamic library =
9;./;/usr/lib/php/modules/;/usr/lib/pgsql/curl.so' - ./;/usr/lib/php/mo=
dules/;/usr/lib/pgsql/curl.so: cannot open shared object file: No such file=
or directory in Unknown on line 0

new,monospace;">

PHP Warning:=A0 PHP Sta=
rtup: Unable to load dynamic library './;/usr/lib/php/modules/;/usr/lib=
/pgsql/fileinfo.so' - ./;/usr/lib/php/modules/;/usr/lib/pgsql/fileinfo.=
so: cannot open shared object file: No such file or directory in Unknown on=
line 0



PHP Warning:=A0 PHP Sta=
rtup: Unable to load dynamic library './;/usr/lib/php/modules/;/usr/lib=
/pgsql/json.so' - ./;/usr/lib/php/modules/;/usr/lib/pgsql/json.so: cann=
ot open shared object file: No such file or directory in Unknown on line 0<=
/span>


PHP Warning:=A0 PHP Sta=
rtup: Unable to load dynamic library './;/usr/lib/php/modules/;/usr/lib=
/pgsql/ldap.so' - ./;/usr/lib/php/modules/;/usr/lib/pgsql/ldap.so: cann=
ot open shared object file: No such file or directory in Unknown on line 0<=
/span>


PHP Warning:=A0 PHP Sta=
rtup: Unable to load dynamic library './;/usr/lib/php/modules/;/usr/lib=
/pgsql/mysql.so' - ./;/usr/lib/php/modules/;/usr/lib/pgsql/mysql.so: ca=
nnot open shared object file: No such file or directory in Unknown on line =
0



.
nt-family: courier new,monospace;"> monospace;">.
style=3D"font-family: courier new,monospace;">.






3) On your phpinfo page, it should have something like th=
is:


Configuration File (php.ini) Path =A0 =A0 =A0 /etc/php.ini

Scan this dir for additional .ini files =A0 =A0 =A0 =A0 /etc/php.d
<=
br>



Yes, the phpinfo page has this information.


4) Check w=
hether the rpm put a file in that extra directory, like:


# cat /etc/php.d/pgsql.ini

; Enable pgsql extension module

extension=3Dpgsql.so





Yes, the rpm put that file in /etc/php.d




------=
----------------------
Gustavo Amarilla



--0016e6dab0fd566b97047e5761d3--

Re: Undefined function pg_connect()

am 30.01.2010 13:33:24 von Gustavo Amarilla Santacruz

--001485f44e9a7c8179047e60f638
Content-Type: text/plain; charset=ISO-8859-1

On Fri, Jan 29, 2010 at 10:07 PM, Gustavo Amarilla Santacruz <
gusamasan@gmail.com> wrote:

>
>
> On Thu, Jan 28, 2010 at 8:53 PM, Chris wrote:
>
>> Gustavo Amarilla Santacruz wrote:
>>
>>> Thank you, Bill Moran.
>>>
>>> My httpd is stoped, for default.
>>>
>>> I used the command: service httpd start; then, the following message was
>>> displayed:
>>>
>>> Starting httpd: [Thu Jan 28 20:27:39 2010] [warn] module perl_module is
>>> already loaded, skipping
>>> [Thu Jan 28 20:27:39 2010] [warn] module php5_module is already loaded,
>>> skipping
>>> httpd: Could not reliably determine the server's fully qualified domain
>>> name, using localhost.localdomain for ServerName
>>> [ OK ]
>>>
>>>
>>> But the pg_connect function is not recognized.
>>>
>>
>> Does a phpinfo() page show it loading anything re: pgsql ?
>>
>> Anything in apache logs (/var/log/httpd/error.log probably) ?
>>
>> Could seLinux be involved somehow (I'm not really sure where to look for
>> this, something in /var/log should have some info) ?
>>
>>
>> On your phpinfo page, it should have something like this:
>>
>> Configuration File (php.ini) Path /etc/php.ini
>> Scan this dir for additional .ini files /etc/php.d
>>
>>
>> Check whether the rpm put a file in that extra directory, like:
>>
>> # cat /etc/php.d/pgsql.ini
>> ; Enable pgsql extension module
>> extension=pgsql.so
>>
>> If it didn't, try doing it manually (and restart httpd) and see if pgsql
>> shows up in your phpinfo page now.
>>
>>
>> --
>> Postgresql & php tutorials
>> http://www.designmagick.com/
>>
>>
>
>
> Thank you, Chris
>
>
>
> *1) Does a phpinfo() page show it loading anything re: pgsql ?*
>
> No, no matter info on pgsql.
>
>
> *2) Anything in apache logs (/var/log/httpd/error.log probably) ?*
>
> Yes, i found this:
>
> .
> .
> .
> PHP Warning: PHP Startup: Unable to load dynamic library
> './;/usr/lib/php/modules/;/usr/lib/pgsql/curl.so' -
> ./;/usr/lib/php/modules/;/usr/lib/pgsql/curl.so: cannot open shared object
> file: No such file or directory in Unknown on line 0
> PHP Warning: PHP Startup: Unable to load dynamic library
> './;/usr/lib/php/modules/;/usr/lib/pgsql/fileinfo.so' -
> ./;/usr/lib/php/modules/;/usr/lib/pgsql/fileinfo.so: cannot open shared
> object file: No such file or directory in Unknown on line 0
> PHP Warning: PHP Startup: Unable to load dynamic library
> './;/usr/lib/php/modules/;/usr/lib/pgsql/json.so' -
> ./;/usr/lib/php/modules/;/usr/lib/pgsql/json.so: cannot open shared object
> file: No such file or directory in Unknown on line 0
> PHP Warning: PHP Startup: Unable to load dynamic library
> './;/usr/lib/php/modules/;/usr/lib/pgsql/ldap.so' -
> ./;/usr/lib/php/modules/;/usr/lib/pgsql/ldap.so: cannot open shared object
> file: No such file or directory in Unknown on line 0
> PHP Warning: PHP Startup: Unable to load dynamic library
> './;/usr/lib/php/modules/;/usr/lib/pgsql/mysql.so' -
> ./;/usr/lib/php/modules/;/usr/lib/pgsql/mysql.so: cannot open shared object
> file: No such file or directory in Unknown on line 0
> .
> .
> .
>
>
> *
> 3) On your phpinfo page, it should have something like this:
>
>
> Configuration File (php.ini) Path /etc/php.ini
> Scan this dir for additional .ini files /etc/php.d
>
> *
> Yes, the phpinfo page has this information.
>
> *
> 4) Check whether the rpm put a file in that extra directory, like:
>
>
> # cat /etc/php.d/pgsql.ini
> ; Enable pgsql extension module
> extension=pgsql.so
> *
>
>
> Yes, the rpm put that file in /etc/php.d
>
>
>
>
> ----------------------------
> Gustavo Amarilla
>
>

I commented the php.ini line in the extension_dir parameter:

*Before:*
..
..
..
; Directory in which the loadable extensions (modules) reside.
; http://www.php.net/manual/en/ini.core.php#ini.extension-dir
; extension_dir = "./"
extension_dir = "./;/usr/lib/php/modules/;/usr/lib/pgsql/"
..
..
..


*After:*
..
..
..
; Directory in which the loadable extensions (modules) reside.
; http://www.php.net/manual/en/ini.core.php#ini.extension-dir
; extension_dir = "./"
;extension_dir = "./;/usr/lib/php/modules/;/usr/lib/pgsql/"
..
..
..


Then, a new message was displayed:

"Warning: pg_connect(): Unable to connect to PostgreSQL server: could not
connect to server: Permission denied Is the server running on host
"localhost" and accepting TCP/IP connections on port 5432? could not connect
to server: Permission denied Is the server running on host "localhost" and
accepting TCP/IP connections on port 5432?"




The pg_hba.conf file containt:




# TYPE DATABASE USER CIDR-ADDRESS METHOD

# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1 255.255.255.0 trust
# IPv6 local connections:
host all all ::1/128 ident



What i can do?

Thank you, in advance.


--------------------------
Gustavo Amarilla

--001485f44e9a7c8179047e60f638
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable



On Fri, Jan 29, 2010 at 10:07 PM, Gustav=
o Amarilla Santacruz < l.com">gusamasan@gmail.com> wrote:
ail_quote" style=3D"border-left: 1px solid rgb(204, 204, 204); margin: 0pt =
0pt 0pt 0.8ex; padding-left: 1ex;">



On Thu=
, Jan 28, 2010 at 8:53 PM, Chris < agick@gmail.com" target=3D"_blank">dmagick@gmail.com> wrote:<=
br>
4, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


Gustavo Amarilla Santacruz wrote:

204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thank you, Bill Moran.



My httpd is stoped, for default.



I used the command: service httpd start; then, the following message was di=
splayed:



Starting httpd: [Thu Jan 28 20:27:39 2010] [warn] module perl_module is alr=
eady loaded, skipping

[Thu Jan 28 20:27:39 2010] [warn] module php5_module is already loaded, ski=
pping

httpd: Could not reliably determine the server's fully qualified domain=
name, using localhost.localdomain for ServerName

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 [ =A0OK =A0]





But the pg_connect function is not recognized.




Does a phpinfo() page show it loading anything re: pgsql ?



Anything in apache logs (/var/log/httpd/error.log probably) ?



Could seLinux be involved somehow (I'm not really sure where to look fo=
r this, something in /var/log should have some info) ?





On your phpinfo page, it should have something like this:



Configuration File (php.ini) Path =A0 =A0 =A0 /etc/php.ini

Scan this dir for additional .ini files =A0 =A0 =A0 =A0 /etc/php.d





Check whether the rpm put a file in that extra directory, like:



# cat /etc/php.d/pgsql.ini

; Enable pgsql extension module

extension=3Dpgsql.so



If it didn't, try doing it manually (and restart httpd) and see if pgsq=
l shows up in your phpinfo page now.




--

Postgresql & php tutorials

http://www.desig=
nmagick.com/







Thank you, Chris
=



1) Does a phpinfo() page show it loading an=
ything re: pgsql ?


No, no matter info on pgsql.




2) Anything in apache logs (/var/log/httpd/error.log probably) ?<=
/i>


Yes, i found this:

>.
ont-family: courier new,monospace;"> ,monospace;">.



.
nt-family: courier new,monospace;"> monospace;">PHP Warning:=A0 PHP Startup: Unable to load dynamic library =
9;./;/usr/lib/php/modules/;/usr/lib/pgsql/curl.so' - ./;/usr/lib/php/mo=
dules/;/usr/lib/pgsql/curl.so: cannot open shared object file: No such file=
or directory in Unknown on line 0

new,monospace;">


PHP Warning:=A0 PHP Sta=
rtup: Unable to load dynamic library './;/usr/lib/php/modules/;/usr/lib=
/pgsql/fileinfo.so' - ./;/usr/lib/php/modules/;/usr/lib/pgsql/fileinfo.=
so: cannot open shared object file: No such file or directory in Unknown on=
line 0




PHP Warning:=A0 PHP Sta=
rtup: Unable to load dynamic library './;/usr/lib/php/modules/;/usr/lib=
/pgsql/json.so' - ./;/usr/lib/php/modules/;/usr/lib/pgsql/json.so: cann=
ot open shared object file: No such file or directory in Unknown on line 0<=
/span>



PHP Warning:=A0 PHP Sta=
rtup: Unable to load dynamic library './;/usr/lib/php/modules/;/usr/lib=
/pgsql/ldap.so' - ./;/usr/lib/php/modules/;/usr/lib/pgsql/ldap.so: cann=
ot open shared object file: No such file or directory in Unknown on line 0<=
/span>



PHP Warning:=A0 PHP Sta=
rtup: Unable to load dynamic library './;/usr/lib/php/modules/;/usr/lib=
/pgsql/mysql.so' - ./;/usr/lib/php/modules/;/usr/lib/pgsql/mysql.so: ca=
nnot open shared object file: No such file or directory in Unknown on line =
0




.
nt-family: courier new,monospace;"> monospace;">.
style=3D"font-family: courier new,monospace;">.







3) On your phpinfo page, it should have something like th=
is:



Configuration File (php.ini) Path =A0 =A0 =A0 /etc/php.ini

Scan this dir for additional .ini files =A0 =A0 =A0 =A0 /etc/php.d
>




Yes, the phpinfo page has this information.


4) Check w=
hether the rpm put a file in that extra directory, like:
<=
br>

# cat /etc/php.d/pgsql.ini

; Enable pgsql extension module

extension=3Dpgsql.so





Yes, the rpm put that file in /etc/php.d




------=
----------------------
Gustavo Amarilla




I commented the php.ini lin=
e in the extension_dir =
parameter:

Before:
y: courier new,monospace;">.
nospace;">

.
nt-family: courier new,monospace;"> monospace;">.
style=3D"font-family: courier new,monospace;">; Directory in which the loa=
dable extensions (modules) reside.
new,monospace;">

; ..php.net/manual/en/ini.core.php#ini.extension-dir">http://w ww.php.net/manua=
l/en/ini.core.php#ini.extension-dir

rier new,monospace;">

; extension_dir =3D &qu=
ot;./"

tyle=3D"font-family: courier new,monospace;">extension_dir =3D "./;/us=
r/lib/php/modules/;/usr/lib/pgsql/"

urier new,monospace;">

.
nt-family: courier new,monospace;"> monospace;">.
style=3D"font-family: courier new,monospace;">.




After:
ospace;">.
yle=3D"font-family: courier new,monospace;">.
y: courier new,monospace;">

.
nt-family: courier new,monospace;"> monospace;">; Directory in which the loadable extensions (modules) reside.<=
/span>


; ..php.net/manual/en/ini.core.php#ini.extension-dir">http://w ww.php.net/manua=
l/en/ini.core.php#ini.extension-dir

rier new,monospace;">

; extension_dir =3D &qu=
ot;./"

tyle=3D"font-family: courier new,monospace;">;extension_dir =3D "./;/u=
sr/lib/php/modules/;/usr/lib/pgsql/"

ourier new,monospace;">

.
nt-family: courier new,monospace;"> monospace;">.
style=3D"font-family: courier new,monospace;">.





Then, a new message was displayed:

y: courier new,monospace;">"Warning: pg_connect(): Unable to connect t=
o PostgreSQL server: could not connect to server: Permission denied
Is the server running on host "localhost" and accepting
TCP/IP connections on port 5432?
could not connect to server: Permission denied
Is the server running on host "localhost" and accepting
TCP/IP connections on port 5432?"





The pg_hb=
a.conf file containt:




r new,monospace;"># TYPE=A0 DATABASE  =A0 USER      =A0 CID=
R-ADDRESS        =A0 METHOD

courier new,monospace;">


y: courier new,monospace;"># "local" is for Unix domain socket co=
nnections only

n style=3D"font-family: courier new,monospace;">local   all    =
     all                  =A0 =
            =A0 trust
y: courier new,monospace;">

# IPv4 local connection=
s:

ont-family: courier new,monospace;">host  =A0 all      =A0=
=A0 all         127.0.0.1 255.255.255.0 trust

le=3D"font-family: courier new,monospace;">

# IPv6 local connection=
s:

ont-family: courier new,monospace;">host  =A0 all      =A0=
=A0 all         ::1/128            =
   ident






What i can do?

Thank you, in advance.


-------=
-------------------
Gustavo Amarilla


--001485f44e9a7c8179047e60f638--

Re: Undefined function pg_connect()

am 30.01.2010 13:53:11 von Rod

On 30/01/2010 12:33, Gustavo Amarilla Santacruz wrote:
> "Warning: pg_connect(): Unable to connect to PostgreSQL server: could
> not connect to server: Permission denied Is the server running on host
> "localhost" and accepting TCP/IP connections on port 5432? could not
> connect to server: Permission denied Is the server running on host
> "localhost" and accepting TCP/IP connections on port 5432?"
>
>
>
>
> The pg_hba.conf file containt:
>



Sounds like you're getting somewhere - the PG extension is being found now.

The error above is nothing to do with pg_hba.conf; if the connection was
being denied because of a rule there, the error would say so explicitly.
Rather, it's a network problem of some kind. Is the server actually
running? Is there a firewall preventing access?

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Undefined function pg_connect()

am 31.01.2010 23:21:53 von dmagick

> ; Directory in which the loadable extensions (modules) reside.
> ; http://www.php.net/manual/en/ini.core.php#ini.extension-dir
> ; extension_dir = "./"
> ;extension_dir = "./;/usr/lib/php/modules/;/usr/lib/pgsql/"

These should be colon separated, not semicolon - notice it's trying to
load both paths included:

PHP Warning: PHP Startup: Unable to load dynamic library
'./;/usr/lib/php/modules/;/usr/lib/pgsql/curl.so'

Change it to

extension_dir = "./:/usr/lib/php/modules/:/usr/lib/pgsql/"

> Then, a new message was displayed:
>
> "Warning: pg_connect(): Unable to connect to PostgreSQL server: could
> not connect to server: Permission denied Is the server running on host
> "localhost" and accepting TCP/IP connections on port 5432? could not
> connect to server: Permission denied Is the server running on host
> "localhost" and accepting TCP/IP connections on port 5432?"

"Permission denied" sounds like either file permissions or seLinux is
stopping the connection.

If you have seLinux enabled, try disabling it (don't know how to do
that, sorry) - at least that will tell you if that's the problem.

For file permissions, check your apache user can read where-ever the
postgres socket file is put (normally /tmp/.s.PGSQL.5432 on centos/rhel).

--
Postgresql & php tutorials
http://www.designmagick.com/


--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Undefined function pg_connect()

am 02.02.2010 01:03:34 von Gustavo Amarilla Santacruz

--0016e6d6453a6546bb047e92d6d9
Content-Type: text/plain; charset=ISO-8859-1

Thank you, all.

I had access to the SELinux->Boolean; next, i check the option:

"Allow HTTPD scripts and modules to connect to databases over the network".



Then, a new message was displayed:

Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: Ident
authentication failed for user "gestock" .......


I can login with gestock data (user/password) through the postgresql psql
tool. But from apache i can not.

Note: the php.ini file was not modified.

On Sun, Jan 31, 2010 at 7:21 PM, Chris wrote:

>
> ; Directory in which the loadable extensions (modules) reside.
>> ; http://www.php.net/manual/en/ini.core.php#ini.extension-dir
>> ; extension_dir = "./"
>> ;extension_dir = "./;/usr/lib/php/modules/;/usr/lib/pgsql/"
>>
>
> These should be colon separated, not semicolon - notice it's trying to load
> both paths included:
>
>
> PHP Warning: PHP Startup: Unable to load dynamic library
> './;/usr/lib/php/modules/;/usr/lib/pgsql/curl.so'
>
> Change it to
>
>
> extension_dir = "./:/usr/lib/php/modules/:/usr/lib/pgsql/"
>
> Then, a new message was displayed:
>>
>> "Warning: pg_connect(): Unable to connect to PostgreSQL server: could not
>> connect to server: Permission denied Is the server running on host
>> "localhost" and accepting TCP/IP connections on port 5432? could not connect
>> to server: Permission denied Is the server running on host "localhost" and
>> accepting TCP/IP connections on port 5432?"
>>
>
> "Permission denied" sounds like either file permissions or seLinux is
> stopping the connection.
>
> If you have seLinux enabled, try disabling it (don't know how to do that,
> sorry) - at least that will tell you if that's the problem.
>
> For file permissions, check your apache user can read where-ever the
> postgres socket file is put (normally /tmp/.s.PGSQL.5432 on centos/rhel).
>
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>
>


--
Gustavo Amarilla

--0016e6d6453a6546bb047e92d6d9
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Thank you, all.

I had access to the SELinux->Boolean; next, i che=
ck the option:

=A0 ">"Allow HTTPD scripts and modules to connect to databases over the ne=
twork"
.




Then, a new message was displayed:

y: courier new,monospace;">Warning: pg_connect(): Unable to connect to Post=
greSQL server: FATAL: Ident authentication failed for user "gestock&qu=
ot; .......





I can login with gestock data (user/password) through the postgresq=
l psql tool. But from apache i can not.

Note: the php.ini file was n=
ot modified.

On Sun, Jan 31, 2010 at 7:21=
PM, Chris <dmagi=
ck@gmail.com
>
wrote:


204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
>

204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
; Directory in which the loadable extensions (modules) reside.

; arget=3D"_blank">http://www.php.net/manual/en/ini.core.php#i ni.extension-di=
r


; extension_dir =3D "./"

;extension_dir =3D "./;/usr/lib/php/modules/;/usr/lib/pgsql/"




These should be colon separated, not semicolon - notice it's trying to =
load both paths included:




PHP Warning: =A0PHP Startup: Unable to load dynamic library './;/usr/li=
b/php/modules/;/usr/lib/pgsql/curl.so'



Change it to




extension_dir =3D "./:/usr/lib/php/modules/:/usr/lib/pgsql/"



204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Then, a new message was displayed:



"Warning: pg_connect(): Unable to connect to PostgreSQL server: could =
not connect to server: Permission denied Is the server running on host &quo=
t;localhost" and accepting TCP/IP connections on port 5432? could not =
connect to server: Permission denied Is the server running on host "lo=
calhost" and accepting TCP/IP connections on port 5432?"






"Permission denied" sounds like either file permissions or seLinu=
x is stopping the connection.



If you have seLinux enabled, try disabling it (don't know how to do tha=
t, sorry) - at least that will tell you if that's the problem.



For file permissions, check your apache user can read where-ever the postgr=
es socket file is put (normally /tmp/.s.PGSQL.5432 on centos/rhel).
v>




--

Postgresql & php tutorials

http://www.desig=
nmagick.com/







--
Gustavo Ama=
rilla


--0016e6d6453a6546bb047e92d6d9--

Re: Undefined function pg_connect()

am 02.02.2010 01:13:33 von dmagick

Gustavo Amarilla Santacruz wrote:
> Thank you, all.
>
> I had access to the SELinux->Boolean; next, i check the option:
>
> "Allow HTTPD scripts and modules to connect to databases over the
> network".
>
>
> Then, a new message was displayed:
>
> Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL:
> Ident authentication failed for user "gestock" .......
>
>
> I can login with gestock data (user/password) through the postgresql
> psql tool. But from apache i can not.

It's not using the password, it's just checking the username to see if
you're logged in as 'gestock' (but 'apache' is not 'gestock', hence the
error).

What does your postgresql pg_hba.conf file look like?

--
Postgresql & php tutorials
http://www.designmagick.com/


--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: Undefined function pg_connect()

am 02.02.2010 01:51:00 von Gustavo Amarilla Santacruz

--0016e6d7df780852a3047e938054
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Thank you, Chris.

The pg_hba.conf contained:

# TYPE DATABASE USER CIDR-ADDRESS METHOD

# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1 255.255.255.0 trust
# IPv6 local connections:
host all all ::1/128 ident


Before, i modified to:

# TYPE DATABASE USER CIDR-ADDRESS METHOD

# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1 255.255.255.0 trust
# IPv6 local connections:
host all all ::1/128 trust


Then i can login me. But, how i Know that apache is using IPV6 connections?


On Mon, Feb 1, 2010 at 9:13 PM, Chris wrote:

> Gustavo Amarilla Santacruz wrote:
>
>> Thank you, all.
>>
>> I had access to the SELinux->Boolean; next, i check the option:
>>
>> "Allow HTTPD scripts and modules to connect to databases over the
>> network".
>>
>>
>> Then, a new message was displayed:
>>
>> Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL:
>> Ident authentication failed for user "gestock" .......
>>
>>
>> I can login with gestock data (user/password) through the postgresql psq=
l
>> tool. But from apache i can not.
>>
>
> It's not using the password, it's just checking the username to see if
> you're logged in as 'gestock' (but 'apache' is not 'gestock', hence the
> error).
>
> What does your postgresql pg_hba.conf file look like?
>
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>
>


--=20
Gustavo Amarilla

=BFReciclaste papel, hoy?

--0016e6d7df780852a3047e938054
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Thank you, Chris.

The pg_hba.conf contained:

# TYPE=A0 DATABA=
SE  =A0 USER      =A0 CIDR-ADDRESS        =
=A0 METHOD

# "local" is for Unix domain socket connections=
only
local   all         all      =A0=
                         =A0=
trust


# IPv4 local connections:
host  =A0 all         all=
         127.0.0.1 255.255.255.0 trust
# IPv6 local conn=
ections:
host  =A0 all         all      =
   ::1/128               ident


B=
efore, i modified to:



# TYPE=A0 DATABASE  =A0 USER      =A0 CIDR-ADDRESS  =A0=
       METHOD

# "local" is for Unix domain soc=
ket connections only
local   all         all  =
                         =A0=
    =A0 trust
# IPv4 local connections:


host  =A0 all         all         127.0=
..0.1 255.255.255.0 trust
# IPv6 local connections:
host  =A0 all=
         all         ::1/128    =A0=
        =A0 trust


Then i can login me. But, how =
i Know that apache is using IPV6 connections?







--
Gustavo Ama=
rilla

=BFReciclaste papel, hoy?


--0016e6d7df780852a3047e938054--

Re: Undefined function pg_connect()

am 02.02.2010 01:54:33 von Gustavo Amarilla Santacruz

--0016e6d7e32dba16c2047e938c81
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

I am sorry. Please, ommit the previous post.

The correct post is the following:


Thank you, Chris.

The pg_hba.conf file contained this:

# TYPE DATABASE USER CIDR-ADDRESS METHOD

# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1 255.255.255.0 trust
# IPv6 local connections:
host all all ::1/128 ident


After, i modified it to:

# TYPE DATABASE USER CIDR-ADDRESS METHOD

# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1 255.255.255.0 trust
# IPv6 local connections:
host all all ::1/128 trust


Then i can login me from php scripts. But, how i Know that apache is using
IPV6 connections?

On Mon, Feb 1, 2010 at 9:51 PM, Gustavo Amarilla Santacruz <
gusamasan@gmail.com> wrote:

> Thank you, Chris.
>
> The pg_hba.conf contained:
>
>
> # TYPE DATABASE USER CIDR-ADDRESS METHOD
>
> # "local" is for Unix domain socket connections only
> local all all trust
> # IPv4 local connections:
> host all all 127.0.0.1 255.255.255.0 trust
> # IPv6 local connections:
> host all all ::1/128 ident
>
>
> Before, i modified to:
>
>
> # TYPE DATABASE USER CIDR-ADDRESS METHOD
>
> # "local" is for Unix domain socket connections only
> local all all trust
> # IPv4 local connections:
> host all all 127.0.0.1 255.255.255.0 trust
> # IPv6 local connections:
> host all all ::1/128 trust
>
>
> Then i can login me. But, how i Know that apache is using IPV6 connection=
s?
>
>
>
> On Mon, Feb 1, 2010 at 9:13 PM, Chris wrote:
>
>> Gustavo Amarilla Santacruz wrote:
>>
>>> Thank you, all.
>>>
>>> I had access to the SELinux->Boolean; next, i check the option:
>>>
>>> "Allow HTTPD scripts and modules to connect to databases over the
>>> network".
>>>
>>>
>>> Then, a new message was displayed:
>>>
>>> Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL:
>>> Ident authentication failed for user "gestock" .......
>>>
>>>
>>> I can login with gestock data (user/password) through the postgresql ps=
ql
>>> tool. But from apache i can not.
>>>
>>
>> It's not using the password, it's just checking the username to see if
>> you're logged in as 'gestock' (but 'apache' is not 'gestock', hence the
>> error).
>>
>> What does your postgresql pg_hba.conf file look like?
>>
>>
>> --
>> Postgresql & php tutorials
>> http://www.designmagick.com/
>>
>>
>
>
> --
> Gustavo Amarilla
>
> =BFReciclaste papel, hoy?
>



--=20
Gustavo Amarilla

=BFReciclaste papel, hoy?

--0016e6d7e32dba16c2047e938c81
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

I am sorry. Please, ommit the previous post.

The correct post is the=
following:


Thank you, Chris.

The ily: courier new,monospace;">pg_hba.conf file contained this:
>

# TYPE=A0 DATABASE=A0=
   USER      =A0 CIDR-ADDRESS        =A0 ME=
THOD


ont-family: courier new,monospace;"> ,monospace;"># "local" is for Unix domain socket connections only=



local   all  =
       all                =A0=
              =A0 trust

-family: courier new,monospace;"> nospace;"># IPv4 local connections:
new,monospace;">

host  =A0 all  =
       all         127.0.0.1 255.255.255.0 trus=
t

nt-family: courier new,monospace;"># IPv6 local connections:
e=3D"font-family: courier new,monospace;">

host  =A0 all  =
       all         ::1/128      =A0=
      =A0 ident



After, i modified it to:
<=
br># TYPE=A0 DATABASE=
  =A0 USER      =A0 CIDR-ADDRESS        =A0=
METHOD




y: courier new,monospace;"># "local" is for Unix domain socket co=
nnections only

n style=3D"font-family: courier new,monospace;">local   all    =
     all                  =A0 =
            =A0 trust
y: courier new,monospace;">

# IPv4 local connection=
s:

ont-family: courier new,monospace;">host  =A0 all      =A0=
=A0 all         127.0.0.1 255.255.255.0 trust

le=3D"font-family: courier new,monospace;">

# IPv6 local connection=
s:

ont-family: courier new,monospace;">host  =A0 all      =A0=
=A0 all         ::1/128            =
   trust





Then i can login me from php scripts. But, how i Know that apache i=
s using IPV6 connections?

On Mon, Feb 1, =
2010 at 9:51 PM, Gustavo Amarilla Santacruz < =3D"mailto:gusamasan@gmail.com">gusamasan@gmail.com> wrote: r>

204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Thank you, Chris.=


The pg_hba.conf contained:


# TYPE=A0 DATAB=
ASE  =A0 USER      =A0 CIDR-ADDRESS        =
=A0 METHOD



# "local" is for Unix domain socket connections only
local=
   all         all            =
                     trust

# IPv4 local connections:
host  =A0 all         all=
         127.0.0.1 255.255.255.0 trust
# IPv6 local conn=
ections:
host  =A0 all         all      =
   ::1/128               ident


<=
/div>Before, i modified to:





# TYPE=A0 DATABASE  =A0 USER      =A0 CIDR-ADDRESS  =A0=
       METHOD

# "local" is for Unix domain soc=
ket connections only
local   all         all  =
                         =A0=
    =A0 trust
# IPv4 local connections:



host  =A0 all         all         127.0=
..0.1 255.255.255.0 trust
# IPv6 local connections:
host  =
=A0 all         all         ::1/128  =
             trust


Then i can login me. =
But, how i Know that apache is using IPV6 connections?






On Mon, Feb 1, 2010 at 9:13 PM, Chris pan dir=3D"ltr"><=
dmagick@gmail.com
> wrote:
" style=3D"border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0=
..8ex; padding-left: 1ex;">


Gustavo Amarilla Santacruz wrote:

204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thank you, all.



I had access to the SELinux->Boolean; next, i check the option:



=A0"Allow HTTPD scripts and modules to connect to databases over the n=
etwork".





Then, a new message was displayed:



Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: Ident=
authentication failed for user "gestock" .......





I can login with gestock data (user/password) through the postgresql psql t=
ool. But from apache i can not.




It's not using the password, it's just checking the username to see=
if you're logged in as 'gestock' (but 'apache' is not =
'gestock', hence the error).



What does your postgresql pg_hba.conf file look like?
<=
br>


--

Postgresql & php tutorials

http://www.desig=
nmagick.com/







<=
div>
--
Gustavo Amarilla

=BFReciclaste pa=
pel, hoy?




--
Gustavo Ama=
rilla

=BFReciclaste papel, hoy?


--0016e6d7e32dba16c2047e938c81--